﻿@model BeanOverflow.Models.MemberProfile

@section Styles {
    <link href="@Url.Content("~/Content/Profile.css")" rel="stylesheet" type="text/css" />
}

@{
    ViewBag.Title = "Edit";
}

<h2>@Html.DisplayFor(model => model.UserId)</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit", "MemberProfile", FormMethod.Post, new {enctype = "multipart/form-data"})) {
    @Html.ValidationSummary(true)
        <div class="profileImage">
            @if (Model.ImageData == null)
            {
                <div class="image">None</div>
            }
            else
            {
                <img class="image" src="@Url.Action("Image", "MemberProfile", new { id = @Model.UserId })" />
            }
            <div class="editor-image">Upload new image: </div>
            <div class="editor-field">
                <input type="file" name="Image" />
            </div>
        </div>

        @Html.HiddenFor(model => model.UserId)
        <div class="profileInfoContainer">
            <div class="editor-label">
                @Html.LabelFor(model => model.Position)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Position)
                @Html.ValidationMessageFor(model => model.Position)
            </div>

            <!--<div class="editor-label">
               Role
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.role)
                @Html.ValidationMessageFor(model => model.role)
            </div> -->
            <div class="editor-label">
                @Html.LabelFor(model => model.Bio)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Bio)
                @Html.ValidationMessageFor(model => model.Bio)
            </div>

           <!--  <div class="editor-label">
                @Html.LabelFor(model => model.companyId)
            </div>
           <div class="editor-field">
                @Html.EditorFor(model => model.companyId)
                @Html.ValidationMessageFor(model => model.companyId)
            </div>-->
        </div>
    <div class="clear"></div>
        <p>
            <input type="submit" value="Save" />
        </p>
}

<div>
    @Html.ActionLink("Back", "Index")
</div>
